package net.learn.piggy.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAspect {
    @Pointcut("execution(public * net.learn.piggy.web.controller.*.*(..))")
    private void pointCut(){
    }

    @Around("pointCut()")
    public Object aroundHandler(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("--------------before");
        Object proceed = pjp.proceed();
        System.out.println("--------------after");
        return proceed;
    }
}
